// 个数              查找单词 第k个
// 3    abc bca cab   abc     1
let arr = readline().split(' ')

let j = 0
let num = arr[j++]

let shouji = []
for (let i = 0; i < num; i++) {
  shouji.push(arr[j++])
}
let target = arr[j++]
let k = arr[j++]

let findNum = 0
let findArr = []

for (let i = 0; i < num; i++) {
  if (
    target !== shouji[i] &&
    shouji[i].split('').sort().join('') === target.split('').sort().join('')
  ) {
    findNum++
    findArr.push(shouji[i])
  }
}
findArr.sort()
console.log(findNum)

if (findArr[k - 1]) {
  console.log(findArr[k - 1])
}
